openssl
#生成私钥
genrsa -out rsa_private_key.pem 2048
#Java开发者需要将私钥转换成PKCS8格式
pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform PEM -nocrypt -out rsa_private_key_pkcs8.pem
#生成公钥
rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem
#退出OpenSSL程序
exit